package com.demo.api.simple;

import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;

import java.time.LocalTime;

/**
 * 简单任务，实现SimpleJob接口，实现execute方法，里面是具体任务逻辑
 */
public class MySimpleJob implements SimpleJob {
  @Override
  public void execute(ShardingContext shardingContext) {
    LocalTime time = LocalTime.now();
    System.out.println(time + "，我是分片项：" + shardingContext.getShardingItem() +
        "，总分片项：" + shardingContext.getShardingTotalCount() + "，taskId" +
        shardingContext.getTaskId());
  }
}
